<?php

class Application_Form_Acceso extends Zend_Form
{
    
    public function init()
    {

        $this->setMethod('post');
		$this->setAttrib('id', 'ajax_form');


		$this->setDecorators(
			array(	"FormElements",
					array("HtmlTag", array("tag" => "table")),
					"Form"
			)
		);




        $model=new Application_Model_AclGroup();
        $options=$model->getAssoc('id','grupo',null,'grupo');


        $grupos = new Zend_Form_Element_MultiCheckbox('grupos');
        $grupos->setMultiOptions($options)
            ->setLabel('Grupos a los que pertenece el usuario')
            ->setAttrib('size',25);
            
            

		$this->addElement($usuario)
             ->addElement($nombre)
			 ->addElement($mail)
             ->addElement($tlf)
             ->addElement($estado)
             ->addElement($grupos);
        
        
       $this->setElementDecorators(array(
		    'ViewHelper',
		   'Errors',
		    array(array('data' => 'HtmlTag'),	array('tag' => 'td', 'class' => 'element')   ),
		    array('Label', array('tag' => 'td')),
		    array(array('row' => 'HtmlTag'), array('tag' => 'tr')),
		));
        
        $this->addElement(new Sgit_Form_Element_Hidden('creado'));
        $this->setElementFilters(array('StringTrim'));
 
    }
}
